<template>
	<view class="container">
		<uni-steps :active="current" :options="[{title: '基本信息'}, {title: '房源信息'}, {title: '进入审批'}]"
			activeColor="#E62029" class="step">
		</uni-steps>
		<view class="content">
			<view v-show="current === 0">
				<register-form @sumbit="submit" :btn_title="btn_title" @nextpage="nextPage"></register-form>
				<!-- <button @click="submitForm"></button> -->
			</view>
			<view v-show="current === 1">
				<create-house-form @click="submitHousingInformation"></create-house-form>
			</view>
			<view v-show="current === 2">
				<!-- <u-toast ref="uToast"></u-toast> -->
				<button @click="intoHome" class="house-btn-sumbit intohome">完成</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		// components: {
		// 	uToast
		// },
		data() {
			return {
				current: 0,
				btn_title: "下一页"
			};
		},
		methods: {
			submitForm() {
				this.current = 1
			},
			submitHousingInformation() {
				this.current = 2
				uni.showToast({
					title: "提交成功,请耐心等待工作人员审核 审核结果将以手机短信通知",
					icon: "none",
					// image: '/static/other_icons/success.png'
				})
				// this.$refs.uToast.show({
				// 	message: '提交成功,请耐心等待工作人员审核 审核结果将以手机短信通知',

				// 	complete() {
				// 		// params.url && uni.navigateTo({
				// 		// 	url: params.url
				// 		// })
				// 	}
				// })
			},
			nextPage() {
				this.current += 1
			},
			intoHome() {
				uni.switchTab({
					url: "/pages/home/home"
				})
			}
		},
	}
</script>

<style lang="scss">
	.container {
		display: flex;
		flex-direction: column;

		.step {
			margin-top: 10rpx;
		}

		.content {
			background: #F5F5F5;

		}
	}

	.house-btn-sumbit {
		margin: 80rpx 95rpx 93rpx 95rpx;
		background: linear-gradient(90deg, #E62129 0%, #BA000A 100%);
		box-shadow: 0rpx 5rpx 15rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 44rpx;
	}

	.intohome {
		margin-top: 860rpx;
	}
</style>
